package jungsun;

import java.util.Scanner;

public class J10SungJuk {
	
	// return 이용한 메서드
	//  주의 :Scanner 클래스를 이용해서 입력처리하고
	//  close()하면 다시 Scanner 생성불가
	public static void main(String[]args){
		//변수
		String name; // String name[]=new String[2];
		int kor,eng,math;// int point[]=new int[3+1];
		int tot;// int tot[]=new int[2];
		double avg;// double avg[]=new double[2];
		char grd; //추가
		
		
		
		//inputSunJuk();// 메서드 사용시 이용함
		name= inputName(makeScanner());
		kor= inputKor(makeScanner());
		eng= inputEng(makeScanner());
		math= inputMath(makeScanner());
	   tot=getTotal(kor,eng,math);
	   avg=getAvg(tot);
	   grd =getGrade(avg);
		//
		
		//
		System.out.println(name);
		System.out.println(kor);
		System.out.println(eng);
		System.out.println(math);
		System.out.println(tot);
		System.out.println(avg);
		System.out.println(grd);
		
	}
	



	private static int inputMath(Scanner sc) {
		int math;
		System.out.println("수학점수?");
		math = sc.nextInt();
		closeSanner(sc);
		return  math;
	}


	private static int inputEng(Scanner sc) {
		int eng;
		System.out.println("영어점수?");
		eng = sc.nextInt();
		return  eng;
		
	}


	private static int inputKor(Scanner sc) {
		int kor;
		System.out.println("국어점수?");
		kor = sc.nextInt();
		return kor;
	}


	private static String inputName(Scanner sc){
		String name;
		System.out.println("이름은=?");
		name = sc.next();
		
		return name;
	}


	private static int getTotal(int kor, int eng, int math) {
		int tot;
		tot = kor + eng + math;
		return tot;
	}
  
	public static double getAvg(int tot){
		  double avg =(double)tot/3;
		   return avg;
	  }
	 
// Scanner 생성
	public	static Scanner makeScanner(){
		Scanner sc = new Scanner(System.in);
	
		return sc;
	}
// Scanner 소멸
	public static void closeSanner(Scanner sc){
		sc.close();
	}
	
	
	  private static char getGrade(double avg){
		  char grd;
		  switch((int)avg/10){
		  case 10:;
		  case 9:grd = '수';break;
		  case 8:grd = '우';break;
		  case 7:grd = '미';break;
		  case 6:grd = '양';break;
		  default:grd = '가';break;
		  }		  
		  return  grd;
				}
}// main
